<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ include file="/interceptor.jsp"%>
<%@page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人账户</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function logincheck(){
		var pword =document.getElementById("upassword").value;
		var Pwd = document.getElementById("Pwd").value;
		var oldPwd = document.getElementById("oldPwd").value;
		var rePwd = document.getElementById("rePwd").value;
		if(Pwd!=oldPwd){
			alert('旧密码错误');
			return false;
		} if(pword == null ||pword==""){
			alert('密码不能为空！');
			return false;
		} if(rePwd!=pword){
			alert('密码不一致');
			return false;
		} if(confirm("您确定要修改吗？")){
			document.forms[0].submit();
		}
	}
	function back() {
			history.go(-1);
	}
</script>
</head>

<body>
<%-- <%@ include file="login_check.jsp" %> --%>

<form id="myForm" name="myForm" action="userupdatePwd" method="post">
	<div class="action">
		<div class="t">
			修改密码
			<input type="hidden" name="hiddenPwd" value="${user.userPwd}" id="oldPwd"/>
		</div>
		<div class="pages">
			<table width="90%" border="0" cellspacing="0" cellpadding="0" style="margin-top:30px">
				<tr>
					<td align="right" width="30%">用户名：</td>
                    <td align="left">
                    	<input type="text" style="width:140px;height:20px" name="userName" value="${user.userName}" readonly="readonly" id="uname"/>
                    </td>
				</tr>
				<tr >
					<td align="right" width="30%">旧密码：</td>
                    <td align="left">
                    	<input type="password" style="width:140px;height:20px" name="oldPwd" id="Pwd"/>
                        <font color="red">*</font>
                    </td>
				</tr>
				<tr >
					<td align="right" width="30%">新密码：</td>
                    <td align="left">
                    	<input type="password" style="width:140px;height:20px" name="userPwd" id="upassword"/>
                        <font color="red">*</font>
                    </td>
				</tr>
				<tr >
					<td align="right" width="30%">确认密码：</td>
                    <td align="left">
                    	<input type="password" style="width:140px;height:20px" name="rePwd" id="rePwd"/>
                        <font color="red">*</font>
                    </td>
				</tr>
				
				<tr >
					<td align="center" colspan="2"><br/>
                    	<input type="button"  id="save" value="保存数据" onclick="logincheck();"/>
                   		<input type="button"  id="re_to" value="返回" onclick="back();" />
                    </td>
				</tr>
			</table>			
		</div>
	</div>
</form>
</body>
</html>